class UtilTagLib {
	def dateFormat = { attrs ->
		out << new java.text.SimpleDateFormat(attrs.format)
                           .format(attrs.value)
	}
	
	def dateInputFormat = {
		out << "Format: 'MM/DD/YYYY'"
	}	
	
	def displayDataType = {attrs ->
	    def dataTypeService = new DataTypeService()
		out << dataTypeService.getDataTypeDesc(attrs.value)		
	}

	def displayOperator = {attrs ->
		def operatorService = new OperatorService()
		out << operatorService.getOperatorDesc(attrs.value)
	}
	
	def reportList = {attrs->
		out << render(template:"/templates/common/reportListTemplate",
		              model:[reportList:attrs.value])
	}
	
	def paramList = {attrs->
		out << render(template:"/templates/common/parameterListTemplate",
					  model:[parameterList:attrs.value] )
	}
	
	def operatorOption = { attrs ->
		out << render(template:"/templates/common/operatorOptionTemplate",
						model:[operatorOptions:attrs.operatorOptions,
						       idOperatorSelected:attrs.idOperatorSelected])
	}
	
	
	def entityHeading = { attrs ->
		out << render(template:"/templates/common/entityHeadingTemplate",
						model:[value:attrs.value])
	}
	
	def otherEntryHeading = { attrs ->
		out << render(template:"/templates/common/otherEntryHeadingTemplate",
						model:[value:attrs.value])
	}
	
	def dateEntryScreen = {attrs->
		def operatorService = new OperatorService()
		def dateOperatorList = operatorService.loadDateOperator()
		out << render(template:"/templates/common/dateEntryScreenTemplate",
					model:[rptParam:attrs.rptParam, dateOperatorList:dateOperatorList,
						    showDateDiv4:attrs.showDateDiv4, showDateDiv5:attrs.showDateDiv5, 
						    showDateDiv6:attrs.showDateDiv6, showDateDiv7:attrs.showDateDiv7,
							showDateDiv8:attrs.showDateDiv8, showDateDiv9:attrs.showDateDiv9,
							dateBetween1Str:attrs.dateBetween1Str, dateBetween2Str:attrs.dateBetween2Str,
							dateGreaterEqualStr:attrs.dateGreaterEqualStr, dateLessEqualStr:attrs.dateLessEqualStr,
							dateEqualStr:attrs.dateEqualStr])	
	}
	
	def numberEntryScreen ={attrs->
		def operatorService = new OperatorService()
		def numOperatorList = operatorService.loadNumberOperator()
		out << render(template:"/templates/common/numberEntryScreenTemplate",
					model:[rptParam:attrs.rptParam, showNumDiv5:attrs.showNumDiv5,
						    showNumDiv1:attrs.showNumDiv1, showNumDiv2:attrs.showNumDiv2,
							showNumDiv3:attrs.showNumDiv3, showNumDiv4:attrs.showNumDiv4,
							numOperatorList:numOperatorList])
	
	}
	
	def stringEntryScreen={attrs->
		def operatorService = new OperatorService()
		def strOperatorList = operatorService.loadStringOperator()
		out << render(template:"/templates/common/stringEntryScreenTemplate",
						model:[rptParam:attrs.rptParam, strOperatorList:strOperatorList])	
	}
	
	def codeEntryScreen={attrs->
		out << render(template:"/templates/common/codeEntryScreenTemplate",
						model:[codeSourceList:attrs.codeSourceList,
							   codeSelectedList:attrs.codeSelectedList,
							   rptParam:attrs.rptParam, addOne:attrs.addOne, minusOne:attrs.minusOne,
							   addAll:attrs.addAll, minusAll:attrs.minusAll])
	}
	
	def entityEntryScreen={attrs->
		def operatorService = new OperatorService()
		def strOperatorList = operatorService.loadStringOperator()
		out << render(template:"/templates/common/entityEntryScreenTemplate",
						model:[codeSourceList:attrs.codeSourceList,strOperatorList:strOperatorList,
							   codeSelectedList:attrs.codeSelectedList,
							   rptParam:attrs.rptParam, addOne:attrs.addOne, minusOne:attrs.minusOne,
							   addAll:attrs.addAll, minusAll:attrs.minusAll])
	}
	
	def booleanEntryScreen={attrs->
	    def operatorService = new OperatorService()
		def booleanOperatorList = operatorService.loadBooleanOperator()
		out << render(template:"/templates/common/booleanEntryScreenTemplate",
						model:[rptParam:attrs.rptParam, booleanOperatorList:booleanOperatorList])
	}
	
	def yesNoEntryScreen={attrs->
		def operatorService = new OperatorService()
		def yesNoOperatorList = operatorService.loadYesNoOperator()
		out << render(template:"/templates/common/yesNoEntryScreenTemplate",
						model:[rptParam:attrs.rptParam, yesNoOperatorList:yesNoOperatorList])
	}
	
	def errorMsg={attrs ->
		out << render(template:"/templates/common/errorMsgTemplate",
		               model:[message:attrs.message])
	}
	
}
